﻿namespace NtRuirun.Mes
{
    public partial class MesService : IMesContract
    {
        /// <summary>
        /// 初始化一个<see cref="MesService"/>类型的新实例
        /// </summary>
        public MesService(IServiceProvider provider)
        {
            ServiceProvider = provider;
            Logger = provider.GetLogger(GetType());
        }

        #region 属性
        /// <summary>
        /// 获取 服务提供者对象
        /// </summary>
        protected IServiceProvider ServiceProvider { get; }

        /// <summary>
        /// 获取 日志对象
        /// </summary>
        protected ILogger Logger { get; }

        /// <summary>
        /// 获取 事件总线
        /// </summary>
        protected IEventBus EventBus => ServiceProvider.GetService<IEventBus>();

        #endregion

    }
}
